package cn.wsalix.type;

public enum FavoriteEnum {
	article("0", "文章"),shop("1", "店铺"),product("2", "商品"),ploy("3", "活动"),user("4", "用户");
	private String code;
	private String title;

	FavoriteEnum(String code, String title) {
		this.code = code;
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public static FavoriteEnum findByCode(String code) {
		for (FavoriteEnum userKind : FavoriteEnum.values()) {
			if (userKind.getCode().equals(code)) {
				return userKind;
			}
		}
		return null;
	}

}
